package com.itbaizhan.config;

import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.retry.ExponentialBackoffRetry;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author spf
 * @date 2024/4/26
 * @time 13:59
 */
@Configuration
public class ZookeeperConfig {

    @Bean
    public CuratorFramework zookeeperClient(){
        CuratorFramework client = CuratorFrameworkFactory.newClient("192.168.66.100:2181", new ExponentialBackoffRetry(1000, 2));
        client.start();
        return client;
    }

}
